import {request} from "./config";


export const getLogs = () => {
    return request('get', '/log')
}

export const getModel = () => {
    return request('get', '/model')
}

export const setSwitch = (data: any) => {
    return request('post', '/switch', data)
}

export const set = (data: any) => {
    return request('post', '/set', data)
}
export const login = (data: any) => {
    return request('post', '/login', data)
}

export const reg = (data: any) => {
    return request('post', '/reg', data)
}

export const iotList=()=>{
    return request('get', `/iot/list?timeStamp=${new Date().getTime()}`)
}

export const iotAdd=(name:string)=>{
    return request('post', '/iot/add',name)
}
export  const iotDel = (data:any)=>{
    return request('post','/iot/del',data)
}

export  const iotEdit = (data:any)=>{
    return request('post','/iot/edit',data)
}

export const iotSwitch = (data:any)=>{
    return request('post','/iot/switch',data)
}